import { GObject, GRoot, UIPackage } from "fairygui-cc";
import { BaseSystem } from "./BaseSystem";

/*
 * @Author: your name
 * @Date: 2021-06-26 16:17:08
 * @LastEditTime: 2021-06-30 01:25:21
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 */
export class UISystem extends BaseSystem {

    protected async init() {
        // 初始化FGUI
        const root = GRoot.create();
        root.makeFullScreen();
        root.node.setSiblingIndex(0);

        // // 预加载
        // await this.preLoad("fgui/com");
    }

    // /**
    //  * 加载地图配置
    //  * @returns 
    //  */
    // protected async preLoad(path: string) {
    //     await new Promise((resolve, reject) => {
    //         UIPackage.loadPackage(path, (error: any, pkg: UIPackage) => {
    //             resolve(true);
    //         });
    //     });
    // }
}